<template>

    <tr>
          <th>
            <input type="checkbox" v-model="checked"  @click="checkboxFn" /> 
          </th>
          <th>{{name}}</th>
          <th>{{price}}</th>
          <th><button @click="delFn">-</button>{{num}}<button @click="jiaFn">+</button></th>
          <th>{{price*num}}</th>
          <th><button @click="delBtn">删除</button></th>
        </tr>
  
</template>
 
<script>
export default {
  name: "",
  components: {},
  props: ['name','price','num','checked','index'],
  data() {
    return {};
  },
  computed: {},
  watch: { },
  created() {},
  methods: {
    delFn() {
      this.$emit('harry',this.index,-1)
    },
    jiaFn() {
      this.$emit('harry',this.index,1)
    },
    delBtn() {
      this.$emit('delbtn',this.index)
    },
    checkboxFn() {
      this.$emit('checked',this.index)
    }
  }
};
</script>

<style scoped>
    tr {
  text-align: center;
}
button {
  margin: 0 10px;
} 
</style>